Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: default AUFS -> OverlayFS whiteout conversion for squashfs #26

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Oct 18, 2023

By default, replace AUFS whiteout markers with OverlayFS whiteout markers when converting a layer from TAR to SquashFS.

It is expected that SquashFS layers will be used via direct mount, rather than extraction to disk. Therefore, the whiteout markers must be in a format that supports assembling multiple mounted layers into a rootfs, using OverlayFS.

A .wh.file marker indicating a whiteout of file is replaced by file as a 0:0 character device.

A dir/.wh..wh..opq marker indicating an opaque directory is replaced with the trusted.overlay.opaque="y" xattr on dir.

A two-pass approach is required. AUFS directory opaque markers are not required to be adjacent to the directory to which they apply, in the tar stream. As tar2sqfs and sqfstar do not support tar files with two instances of the same dir/file, we cannot append an additional tar entry if we come across an opaque marker distant from the target directory entry.

A new option OptNoConvertWhiteout will disable whiteout conversion. This can be employed by callers to avoid unneccessary processing where the layer is part of a squashed / single-layer image that will not have any whiteout markers.

Fixes #25

@dtrudg dtrudg self-assigned this Oct 18, 2023
@dtrudg dtrudg force-pushed the issue25 branch 4 times, most recently from 30435aa to 8a68bc9 Compare October 18, 2023 13:14
Copy link
Member

@tri-adam tri-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of suggestions/questions, thank you!

pkg/mutate/squashfs.go Outdated Show resolved Hide resolved
pkg/mutate/squashfs.go Outdated Show resolved Hide resolved
By default, replace AUFS whiteout markers with OverlayFS whiteout
markers when converting a layer from TAR to SquashFS.

It is expected that SquashFS layers will be used via direct mount,
rather than extraction to disk. Therefore, the whiteout markers must
be in a format that supports assembling multiple mounted layers into a
rootfs, using OverlayFS.

A `.wh.file` marker indicating a whiteout of `file` is replaced by
`file` as a 0:0 character device.

A `dir/.wh..wh..opq` marker indicating an opaque directory is replaced
with the `trusted.overlay.opaque="y"` xattr on `dir`.

A two-pass approach is required. AUFS directory opaque markers are not
required to be adjacent to the directory to which they apply, in the
tar stream. As `tar2sqfs` and `sqfstar` do not support tar files with
two instances of the same dir/file, we cannot append an additional tar
entry if we come across an opaque marker distant from the target
directory entry.

A new option `OptNoConvertWhiteout` will disable whiteout
conversion. This can be employed by callers to avoid unneccessary
processing where the layer is part of a squashed / single-layer image
that will not have any whiteout markers.

Fixes sylabs#25
@dtrudg dtrudg changed the title feat: support AUFS -> OverlayFS whiteout conversion for squashfs feat: default AUFS -> OverlayFS whiteout conversion for squashfs Oct 19, 2023
@dtrudg dtrudg marked this pull request as ready for review October 19, 2023 11:19
@dtrudg dtrudg requested a review from tri-adam October 19, 2023 11:19
pkg/mutate/squashfs.go Outdated Show resolved Hide resolved
pkg/mutate/squashfs.go Show resolved Hide resolved
pkg/mutate/squashfs.go Show resolved Hide resolved
pkg/mutate/squashfs.go Show resolved Hide resolved
pkg/mutate/whiteout.go Outdated Show resolved Hide resolved
@dtrudg dtrudg requested a review from tri-adam October 19, 2023 15:18
@tri-adam tri-adam merged commit 655ff77 into sylabs:main Oct 19, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional conversion from AUFS to OverlayFS whiteout format in tar -> squashfs
2 participants